<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #box,
        #box1 {
            background-color: deeppink;
            font-weight: bold;
            height: 30px;
            width: 30px;
        }

        #box {
            position: absolute;
            top: 50%;
            left: 50%;
        }
    </style>
</head>

<body>
    <div id="box"></div>
    <div id="box1"></div>
    <script src="./lib/jquery-1.11.3/jquery.js"></script>
    <script>
        let box = document.getElementById('box')
        let box1 = document.getElementById('box1')

        let topnew = box.offsetTop;
        let leftnew = box.offsetLeft;
        let bottomnew = box.offsetTop + box.offsetHeight;
        let rightnew = box.offsetLeft + box.offsetWidth;
        console.log(topnew, leftnew, bottomnew, rightnew);
    </script>
</body>

</html>